package com.ymm.system.core.repo;

import com.ymm.lulutong.dto.OrderShipperDTO;
import com.ymm.lulutong.service.ShipperProfileService;
import com.ymm.lulutong.utils.Result;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author zikang.yao
 * @Description 货主相关的rpc接口
 * @Date 2022/8/5 17:00
 * @Version 1.0
 */
@Component
public class ShipperRelatedRepo {

    @Reference(version = "server")
    private ShipperProfileService shipperProfileService;

    public Result<List<OrderShipperDTO>> batchGetShipperInfo(List<Long> ShipperIds){
        return shipperProfileService.listOrderShipperDTOsByShipperIds(ShipperIds);
    }

    public Result<OrderShipperDTO> getShipperInfo(Long shipperId){
        System.out.println(shipperId);
        return shipperProfileService.getOrderShipperDTO(shipperId);
    }

    public Integer getShipperVipPoint(Long shipperId){
        //TODO rpc调用获取货主的会员积分
        return null;
    }

    public Integer updateShipperVipPoint(Long shipperId,Integer shipperVipPoint){
        //TODO rpc更新货主的会员积分
        return null;
    }

    public Integer updateShipperVipLevel(Long shipperId,Integer orderPrice){
        //TODO RPC更新货主的会员等级
        return null;
    }

    public Integer getShipperVipLevel(Long shipperId){
        //TODO RPC调用货主的会员等级
        return null;
    }




}
